package com.wanban.adutils.db;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import com.wanban.adutils.db.bean.AdContent;
import java.util.List;

@Dao
public interface AdDao {

    @Query("SELECT * FROM AdContent WHERE adId=:adId")
    AdContent query(long adId);

    @Query("SELECT * FROM AdContent")
    List<AdContent> queryList();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(AdContent adContent);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(List<AdContent> adContent);

    @Query("DELETE FROM AdContent WHERE adId=:adId")
    void delete(long adId);

    @Query("DELETE FROM AdContent")
    void deleteAll();

}
